package cn.edu.sdjzu.xg.eagle.Service;

import cn.edu.sdjzu.xg.eagle.dao.SchoolDaoImpl;
import cn.edu.sdjzu.xg.eagle.entity.School;
import cn.edu.sdjzu.xg.eagle.util.JdbcHelper;

import java.sql.Connection;
import java.sql.SQLException;

public class SchoolService {
    private final SchoolDaoImpl schoolDao=SchoolDaoImpl.getInstance();
    public boolean addsSchool(School school)throws SQLException{
        Connection connection=null;
        try{
            connection= JdbcHelper.getConn();
            return schoolDao.addSchool(connection,school);
        }finally{
            JdbcHelper.close(connection);
        }
    }
}
